\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{pifont}
\usepackage{multimedia}

\usepackage{listings}
\lstset{language=C++}

\usepackage{verbatim}

\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\usepgflibrary{fpu}
\usepgfplotslibrary{external} 

\tikzexternalize
\pgfplotsset{compat=1.8}

\usepackage{subcaption}
\captionsetup{compatibility=false}

\usepackage{comment}

\usepackage{multimedia}
\usetikzlibrary{fit}

\usetheme{Boadilla}
%\usecolortheme{orchid}
\usecolortheme{orchid}

\definecolor{tecnico}{RGB}{0, 145, 218}
\setbeamercolor{structure}{fg=tecnico}

\title[Autonomous Systems Course]{Autonomous Systems \& Introduction to Robotics}
\subtitle{ROS practical session}
\author[João Quintas \& Rui Bettencourt]{João Quintas \& Rui Bettencourt \\ {\tiny (Oscar Lima \& Carlos Azevedo \& Rute Luz)}}
\date{September 24th 2020}
\institute[ISR]{ISR: Institute for Systems and Robotics\\LARSyS: Laboratory for Robotics and Engineering Systems\\IST: Instituto Superior T\'ecnico, Lisboa Portugal}

\titlegraphic{\centering\includegraphics[height=1.7cm]{logos/isr-lisboa-logo.png}\hspace*{0.0cm}\includegraphics[height=1.8cm]{logos/larsys_logo_new.png}\hspace*{0.0cm}\includegraphics[height=1.5cm]{logos/ist-logo.png}}

\begin{document}

%---------------------------------------------

\begin{frame}
\titlepage
\end{frame}

%---------------------------------------------

\begin{frame}{ROS pkg structure\footnote{\url{http://wiki.ros.org/Packages}}}
	
	\begin{itemize}
		\item ROS nodes, a ROS-independent library, a dataset, configuration files, a third-party piece of software, etc
		\item ROS packages tend to follow a common structure
		\item For python code it will look like this:
		\item To create a package you can use the command: \newline 
		\textit{catkin\_create\_pkg \{name of package\} \{dependencies\}}
	\end{itemize}
	
	% one image
	\begin{figure}[H]
		\centering
		\includegraphics[height=4.0cm]{images/ros_pkg_structure.png}
	\end{figure}
	
\end{frame}

%---------------------------------------------

\begin{frame}{rosbash\footnote{\url{http://wiki.ros.org/rosbash}}}
		
	\begin{itemize}
		\item Offers a set of shell commands for using ros with bash (linux terminal)
		\item Most popular include:
		\begin{itemize}
			\item roscd pkg\_name (cd to pkg\_name easily)
			\item rosed pkg\_name filename (quickly edit a file)
			\item roscat pkg\_name filename (quickly visualize a file in terminal)
			\item rosrun pkg\_name executable (run executable from anywhere without having to give its full path)
		\end{itemize}
		\item enables tab completion on: roslaunch, rosparam, rosnode, rostopic, rosservice, rosmsg, rossrv, rosbag. 
	\end{itemize}

\end{frame}

%---------------------------------------------

\begin{frame}{rosrun\footnote{\url{http://wiki.ros.org/rosbash\#rosrun}}}
	\begin{itemize}
		\item Part of rosbash suite
		\item Usage: rosrun pkg\_name executable\_name
		\item It will run ONLY executable files
		\item About files being executable (important!)
		\begin{itemize}
			\item make sure your python nodes (i.e. my\_python\_node.py) are executable
			\item check by doing: ls -l , if it has an x is executable (i.e. -rwxr--r--)
			\item alternatively, if your terminal has colors, the file shows green when doing ls
			\item rosrun will also look for your compiled c++ executables (under devel/lib/pkg\_name)
		\end{itemize}
	\end{itemize}
	
\end{frame}

%---------------------------------------------

\begin{frame}{Stage simulator\footnote{\url{http://playerstage.sourceforge.net/index.php?src=stage}}}
	\begin{itemize}
		\item Simulates a population of mobile robots, sensors and objects in a two-dimensional bitmapped environment
		\item Stage was designed with multi-agent systems in mind, so it provides fairly simple, computationally cheap models of lots of devices rather than attempting to emulate any device with great fidelity. 
	\end{itemize}
	
	% one image
	\begin{figure}[H]
		\centering
		\includegraphics[height=4.0cm]{images/stage_simulator.png}
	\end{figure}
	
\end{frame}

%---------------------------------------------

\begin{frame}{rostopic\footnote{\url{http://wiki.ros.org/rostopic}}}

	\begin{itemize}
		\item Displays information about ROS topics
		\item Most useful:
		\item rostopic list (get a list of active topics)
		\item rostopic info topic\_name (get topic type, publishers and subscribers)
		\item rostopic echo topic\_name
		\item rostopic pub topic\_name topic\_type msg\_press\_tab! (publish a topic from console), options:
		\begin{itemize}
			\item no args (latched)
			\item -r float\_number (at a certain rate)
			\item - -once (latch for 3 secs, then dies)
		\end{itemize}
		\item rostopic hz topic\_name (get the publish frequency rate)
	\end{itemize}

\end{frame}

%---------------------------------------------

\begin{frame}{roslaunch\footnote{\url{http://wiki.ros.org/roslaunch}}}
	
	\begin{itemize}
		\item A tool for easily launching multiple ROS nodes
		\item Implemented with XML syntax (\textless launch\textgreater ... \textless /launch\textgreater)
		\item Allows to load parameters to param server
		\item A launch file can call other launch files
		\item Launch a node \textless node pkg=”...” type=”...” name=”...” respawn=true ns=”...”/\textgreater
		\item Run syntax: roslaunch pkg\_name my\_file.launch
	\end{itemize}
	
\end{frame}

%---------------------------------------------

\begin{frame}{parameter server\footnote{\url{http://wiki.ros.org/Parameter\%20Server}}}
	\begin{itemize}
		\item Is a shared, multi-variate dictionary that is accessible via network API
		\item Nodes can use this server to store or retrieve parameters during runtime
		\item Is not high performance
		\item Globally viewable
		\item Usage from terminal: rosparam set param\_name param\_value, rosparam get param\_name
		\item Usage from python api: rospy.set\_param(param\_name, param\_value), rospy.get\_param("param\_name")
		\item Suitable for for static, non-binary data such as configuration parameters
	\end{itemize}
	
\end{frame}

%---------------------------------------------

\begin{frame}{Rviz\footnote{\url{http://wiki.ros.org/rviz}}}
	
	\begin{itemize}
		\item 3D visualization tool
		\item Powerful for topic visualization (useful in debugging)
		\item Sensoring state information (laser scans, pointclouds, coordinate frames, cameras)
		\item Can publish some topics (2D pose estimate, 2D nav goal)
		\item Is recommended to comply with ROS standard topics to enable topic visualization
		\item Launch using : rosrun rviz rviz (a roscore must be running)
		\item Not a simulator
	\end{itemize}
	
	\centering
	\url{https://www.youtube.com/watch?v=i--Sd4xH9ZE}
	
\end{frame}


\begin{frame}{Reading Material}
	
	\begin{itemize}
		\item For nice tutorials you can read the book "Programming Robots with ROS: A Practical Introduction to the Robot Operating System"
		\item For a tutorial on turtlebot3 simulation environment you can check 
	\end{itemize}
	\centering
	\url{https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#ros-1-simulation}
	
\end{frame}



%---------------------------------------------

%\begin{frame}{tf \footnote{\url{http://wiki.ros.org/tf}}}
%	\begin{itemize}
%		\item Example tf tree for simulated pioneer + wall-e robot
%	\end{itemize}
%	
%	%	% one image
%	\begin{figure}[H]
%		\centering
%		\includegraphics[height=6.0cm]{images/tf_tree_example.png}
%	\end{figure}
%	
%\end{frame}

%---------------------------------------------

%\begin{frame}{tf (2 part)\footnote{\url{http://wiki.ros.org/tf}}}
%	\begin{itemize}
%		\item Example tf tree for simulated pioneer + wall-e robot
%	\end{itemize}
%
%%	% one image
%	\begin{figure}[H]
%		\centering
%		\includegraphics[height=6.0cm]{images/tf_tree_example.png}
%	\end{figure}
%	
%\end{frame}

%---------------------------------------------

%\begin{frame}{tf (3 part)\footnote{\url{http://wiki.ros.org/tf}}}
%	\begin{itemize}
%		\item A real world example (mbot robot)
%	\end{itemize}
%	
%    % one image
%	\begin{figure}[H]
%		\centering
%		\includegraphics[height=6.0cm]{images/mbot_frames.png}
%	\end{figure}
%	
%\end{frame}

%---------------------------------------------

%\begin{frame}{AMCL}
%	\begin{itemize}
%		\item todo
%	\end{itemize}
%	
%	% one image
%%	\begin{figure}[H]
%%		\centering
%%		\includegraphics[height=9cm]{images/corner_problem.pdf}
%%	\end{figure}
%	
%\end{frame}

%---------------------------------------------

%\begin{frame}{GMapping}
%	\begin{itemize}
%		\item todo
%	\end{itemize}
%	
%	% one image
%	%	\begin{figure}[H]
%	%		\centering
%	%		\includegraphics[height=9cm]{images/corner_problem.pdf}
%	%	\end{figure}
%	
%\end{frame}

%----------------------------------------------

%\begin{frame}{rosbag}
%	\begin{itemize}
%		\item use\_sim\_time parameter, and —clock option for rosbag
%	\end{itemize}
%	
%	% one image
%	%	\begin{figure}[H]
%	%		\centering
%	%		\includegraphics[height=9cm]{images/corner_problem.pdf}
%	%	\end{figure}
%	
%\end{frame}

%---------------------------------------------

\begin{frame}
\begin{LARGE}
\begin{center}
Thank you!\\

Questions? :)\\

\vspace*{1cm}

\footnotesize
If you have a question please create a Github issue so that we can all benefit from the posted answers under:
\\
\url{https://github.com/socrob/autonomous\_systems/issues}

\vspace*{2cm}
\end{center}
\end{LARGE}
\end{frame}

%---------------------------------------------

\end{document}